From: Ian Jackson Date: Tue, 23 Jun 2015 18:22:41 +0000 (+0100) Subject: libxl: When save/restore helper dies, do not overwrite rc X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2984 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:///%22http:/www.example.com/cgi/%22https:/?a=commitdiff_plain;h=acc9a611055f72d5898fda1edbfb4e08956cca3c;p=xen.git libxl: When save/restore helper dies, do not overwrite rc If we already have an rc (eg from ao abort), keep it. Signed-off-by: Ian Jackson Acked-by: Wei Liu --- v4: New patch in this version of the series. --- diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c index 93a884bb7d..087c2d5f36 100644 --- a/tools/libxl/libxl_save_callout.c +++ b/tools/libxl/libxl_save_callout.c @@ -332,19 +332,22 @@ static void helper_exited(libxl__egc *egc, libxl__ev_child *ch, if (status) { libxl_report_child_exitstatus(CTX, XTL_ERROR, what, pid, status); - shs->rc = ERROR_FAIL; + if (!shs->rc) + shs->rc = ERROR_FAIL; } if (shs->need_results) { - if (!shs->rc) + if (!shs->rc) { LOG(ERROR,"%s exited without providing results",what); - shs->rc = ERROR_FAIL; + shs->rc = ERROR_FAIL; + } } if (!shs->completed) { - if (!shs->rc) + if (!shs->rc) { LOG(ERROR,"%s exited without signaling completion",what); - shs->rc = ERROR_FAIL; + shs->rc = ERROR_FAIL; + } } helper_done(egc, shs);